package consys.social.core;

/**
 * This interface provides basic methods to encode objects to String
 * (toString method should be called as an implementation)
 * and also the method to deserialize string to object
 *
 * @author Petr Kunc
 */
public interface BasicTranscoder<T extends Object> {
    /**
     * Encode object to string
     *
     * @param object to be encoded
     * @return encoded string
     */
    String encodeToString (T object);

    /**
     * Decode object from string
     *
     * @param data string to decode
     * @return decoded object
     */
    T decodeFromString(String data);
}
